package haltica.com.mx.ape.domain;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.TableGenerator;
import javax.validation.constraints.NotNull;

import org.springframework.roo.addon.entity.RooEntity;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.tostring.RooToString;

@RooJavaBean
@RooToString
@RooEntity(versionField = "", table = "usuario_sistema")
public class UsuarioSistema {

    @Id
    @TableGenerator(name = "GEN_USU_SIS", table = "sequence", pkColumnName = "SEQ_NAME", valueColumnName = "SEQ_COUNT", pkColumnValue = "SEQ_USU_SIS", allocationSize = 1)
	@GeneratedValue(strategy=GenerationType.TABLE, generator="GEN_USU_SIS")
    @Column(name = "ID_USUARIO", columnDefinition = "INT UNSIGNED")
    private Integer idUsuario;

    @ManyToOne
    @JoinColumn(name = "PERFIL_ROLE", referencedColumnName = "PERFIL_ROLE", nullable = false)
    private PerfilRole perfilRole;

    @Column(name = "NOMBRE_USUARIO", columnDefinition = "VARCHAR", length = 50, unique = true)
    @NotNull
    private String username;

    @Column(name = "PASSWORD", columnDefinition = "VARCHAR", length = 64)
    @NotNull
    private String password;
    
    @Column(name = "NOMBRE", columnDefinition = "VARCHAR", length = 50)
    private String nombre;
    
    @Column(name = "AP_PATERNO", columnDefinition = "VARCHAR", length = 30)
    private String apPaterno;
    
    @Column(name = "AP_MATERNO", columnDefinition = "VARCHAR", length = 30)
    private String apMaterno;
    

    @Column(name = "EMAIL", columnDefinition = "VARCHAR", length = 50)
    @NotNull
    private String email;

    @Column(name = "ENABLED", columnDefinition = "BIT")
    @NotNull
    private Boolean enabled;
    
    @Column(name = "ID_CLIENTE", columnDefinition = "INT UNSIGNED")
    private Integer idCliente;
    
    @Column(name = "ID_SUCURSAL", columnDefinition = "INT UNSIGNED")
    private Integer idSucursal;
}
